package com.lyf.scm.plan.insfrastructure.db.mapper;


import com.lyf.scm.plan.api.dto.PartOfGmvTargetInfo;
import com.lyf.scm.plan.insfrastructure.db.dataobject.DemandPlanDO;
import com.lyf.scm.plan.insfrastructure.db.dataobject.GmvTargetDO;
import com.lyf.scm.plan.insfrastructure.db.dataobject.SalesPlanSelectDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * description:
 * GMV指标（scm_gmv_target）数据库访问层
 *
 * @author: haodong
 * @data: 2020/7/8 16:51
 */
public interface GmvTargetMapper {

    /**
     * 按条件分页查询gmv指标
     * @param salesPlanSelect
     * @return
     */
    List<GmvTargetDO> listPageBySelective(SalesPlanSelectDO salesPlanSelect);

    /**
     * 根据分页后的参数查询
     * @param gmvTarget
     * @return
     */
    List<GmvTargetDO> listBySelective(GmvTargetDO gmvTarget);

    /**
     * 批量新增
     * @param gmvTargetList
     * @return
     */
    Integer batchSave(List<GmvTargetDO> gmvTargetList);

    /**
     * 多条件批量查询
     * @param gmvTargetList
     * @param ifTrue
     * @return
     */
    List<GmvTargetDO> listByBatch(@Param("gmvTargetList") List<GmvTargetDO> gmvTargetList,
                                  @Param("ifTrue") boolean ifTrue);

    /**
     * 批量更新
     * @param gmvTargetList
     * @return
     */
    Integer batchUpdate(List<GmvTargetDO> gmvTargetList);

    List<PartOfGmvTargetInfo> listPartBySelective(SalesPlanSelectDO salesPlanSelectDO);
    List<PartOfGmvTargetInfo> listPartBySelectiveCharts(SalesPlanSelectDO salesPlanSelectDO);
    /**
     * 查询全部
     * @param salesPlanSelect
     * @return
     */
    List<GmvTargetDO> listAllBySelective(SalesPlanSelectDO salesPlanSelect);

    /**
     * 根据id集合查询
     *
     * @param idList
     * @return
     */
    List<GmvTargetDO> listByIdList(List<Long> idList);

    /**
     * 销售目标
     *
     * @param demandPlanDO 需求计划
     * @return {@link List<GmvTargetDO>}
     */
    List<GmvTargetDO> listSaleTarget(DemandPlanDO demandPlanDO);

    /**
     * 删除对应标识的数据
     *
     * @param opSign
     */
    void delete(@Param("opSign") String opSign);

    void deleteByOpSign(String opSign);
}
